package com.common.frame.bean;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.ArrayList;

/**
 * - ActivityResult
 * <p>
 * Created by Sunxy on 2019/1/6.
 */
public class PermissionResult implements Parcelable {
    private int resultCode;
    private ArrayList<String> deniedPermissionExplain;

    public PermissionResult() {
    }

    public PermissionResult(int resultCode, ArrayList<String> deniedPermissionExplain) {
        this.resultCode = resultCode;
        this.deniedPermissionExplain = deniedPermissionExplain;
    }

    public int getResultCode() {
        return resultCode;
    }

    public void setResultCode(int resultCode) {
        this.resultCode = resultCode;
    }


    public ArrayList<String> getDeniedPermissionExplain() {
        return deniedPermissionExplain;
    }

    public void setDeniedPermissionExplain(ArrayList<String> deniedPermissionExplain) {
        this.deniedPermissionExplain = deniedPermissionExplain;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(this.resultCode);
        dest.writeStringList(this.deniedPermissionExplain);
    }

    protected PermissionResult(Parcel in) {
        this.resultCode = in.readInt();
        this.deniedPermissionExplain = in.createStringArrayList();
    }

    public static final Creator<PermissionResult> CREATOR = new Creator<PermissionResult>() {
        @Override
        public PermissionResult createFromParcel(Parcel source) {
            return new PermissionResult(source);
        }

        @Override
        public PermissionResult[] newArray(int size) {
            return new PermissionResult[size];
        }
    };
}
